<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui">

<h:head>
    <title>PrimeFaces Hello World Example</title>
</h:head>

<h:body>
    <h:form id="helloworld-form">

        <p:panel header="PrimeFaces Hello World Example">
            <h:panelGrid columns="2" cellpadding="4">
                <h:outputText value="First Name: "/>
                <p:inputText id="first-name" value="#{helloWorldController.helloWorld.firstName}"/>

                <h:outputText value="Last Name: "/>
                <p:inputText id="last-name" value="#{helloWorldController.helloWorld.lastName}"/>

                <p:commandButton id="submit" value="Submit"
                                 update="greeting-panel"
                                 oncomplete="PF('greetingDialog').show()"/>
            </h:panelGrid>
        </p:panel>

        <p:dialog header="Greeting" widgetVar="greetingDialog"
                  modal="true" resizable="false">
            <h:panelGrid id="greeting-panel" columns="1" cellpadding="4">
                <h:outputText value="#{helloWorldController.showGreeting()}"/>
            </h:panelGrid>
        </p:dialog>

    </h:form>
</h:body>
</html>